<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/common/Head.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0 ,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

	<title>结算页面</title>

	<link href="${resourceServer }/AmazeUI-2.4.2/assets/css/amazeui.css"
		rel="stylesheet" type="text/css" />

	<link href="${resourceServer }/basic/css/demo.css" rel="stylesheet"
		type="text/css" />
	<link href="${resourceServer }/css/cartstyle.css" rel="stylesheet"
		type="text/css" />

	<link href="${resourceServer }/css/jsstyle.css" rel="stylesheet"
		type="text/css" />

	<script type="text/javascript" src="${resourceServer }/js/address.js"></script>
</head>

<body>
	<div id="app" v-cloak>
		<!--顶部导航条 -->
		<div class="am-container header">
			<ul class="message-l">
				<div class="topMessage">
					<div class="menu-hd">
						<a href="#" target="_top" class="h">小明</a> <a href="#"
							target="_top"></a>
					</div>
				</div>
			</ul>
			<ul class="message-r">
				<div class="topMessage home">
					<div class="menu-hd">
						<a href="#" target="_top" class="h">商城首页</a>
					</div>
				</div>
				<div class="topMessage my-shangcheng">
					<div class="menu-hd MyShangcheng">
						<a href="#" target="_top">个人中心</a>
					</div>
				</div>
				<div class="topMessage mini-cart">
					<div class="menu-hd">
						<a id="mc-menu-hd" href="#" target="_top"><span>购物车</span><strong
							id="J_MiniCartNum" class="h"></strong></a>
					</div>
				</div>
				<div class="topMessage favorite">
					<div class="menu-hd">
						<a href="#" target="_top"><span>收藏夹</span></a>
					</div>
			</ul>
		</div>

		<!--悬浮搜索框-->

		<div class="nav white">
			<div class="logo">
				<img src="${resourceServer }/images/logo.png" />
			</div>
			<div class="logoBig">
				<li><img src="${resourceServer }/images/logobig.png" /></li>
			</div>

			<div class="search-bar pr">
				<a name="index_none_header_sysc" href="#"></a>
				<form>
					<input id="searchInput" name="index_none_header_sysc" type="text"
						placeholder="搜索" autocomplete="off"> <input
						id="ai-topsearch" class="submit am-btn" value="搜索" index="1"
						type="submit">
				</form>
			</div>
		</div>

		<div class="clear"></div>
		<div class="concent">
			<!--地址 -->
			<div class="paycont">
				<div class="address">
					<h3>确认收货地址</h3>
					<div class="control">
						<div class="tc-btn createAddr theme-login am-btn am-btn-danger">使用新地址</div>
					</div>
					<div class="clear"></div>
					<!-- ------------------------------------------------------------------------------------ -->
					<ul>
						<!-- --------------------------------------一个地址---------------------------------------------- -->
						<temple v-if="show">
						<div class="per-border"></div>
						<li class="user-addresslist defaultAddr" >
							<!-- defaultAddr -->
							<div class="address-left">
								<div class="user DefaultAddr">

									<span class="buy-address-detail"> <span class="buy-user">{{name}}
									</span> <span class="buy-phone">{{tell}}</span>
									</span>
								</div>
								<div class="default-address DefaultAddr">
									<span class="buy-line-title buy-line-title-type">收货地址：</span> <span
										class="buy--address-detail"> <span class="province">{{sheng}}</span>省
										<span class="city">{{shi}}</span>市 <span class="dist">{{xian}}</span> <span
										class="street">{{addr}}</span>
									</span> </span>
								</div>

							</div>
							<div class="address-right">
								<a href="${resourceServer }/person/address.html"> <span
									class="am-icon-angle-right am-icon-lg"></span></a>
							</div>
							<div class="clear"></div>

							<div class="new-addr-btn">
								<span class="new-addr-bar hidden"></span> <a href="#"></a> <span
									class="new-addr-bar"></span> <!-- <a href="javascript:void(0);"
									onclick="delClick(this);">编辑</a> -->
									<div class="control">
						<div class="tc-btn createAddr theme-login am-btn am-btn-danger">编辑</div>
					</div>
							</div>

						</li>
</temple>


						<!-- --------------------------------------地址结束--------------------------------------- -->
						<!-- ----------------------------------使用vue循环添加--------------------------------------------------- -->

						<%-- <temple v-for="(address,index) of addrlist">

						<div class="per-border"></div>
						<li class="user-addresslist " class="defaultAddr"
							@click="choose(index)">

							<div class="address-left">
								<div class="user DefaultAddr">

									<span class="buy-address-detail"> <span class="buy-user">{{address.name}}
									</span> <span class="buy-phone">{{address.tell}}</span>
									</span>
								</div>
								<div class="default-address DefaultAddr">
									<span class="buy-line-title buy-line-title-type">收货地址：</span> <span
										class="buy--address-detail"> <span class="province">{{address.sheng}}</span>省
										<span class="city">{{address.shi}}</span>市 <span class="dist">{{address.xian}}</span>区
										<span class="street">{{address.addr}}</span>
									</span> </span>
								</div>

							</div>
							<div class="address-right">
								<a href="${resourceServer }/person/address.html"> <span
									class="am-icon-angle-right am-icon-lg"></span></a>
							</div>
							<div class="clear"></div>

							<div class="new-addr-btn">
								<span class="new-addr-bar hidden"></span> <a href="#"></a> <span
									class="new-addr-bar"></span> <a href="javascript:void(0);"
									@click="delClick(index);">删除</a>
							</div>

						</li>
						</temple> --%>

						<!-- ----------------------------------使用vue循环添加--------------------------------------------------- -->
					</ul>
					<div class="clear"></div>
				</div>
				<div class="clear"></div>
				<div class="clear"></div>

				<!--订单 -->
				<div class="concent">
					<div id="payTable">
						<h3>确认订单信息</h3>
						<div class="cart-table-th">
							<div class="wp">

								<div class="th th-item">
									<div class="td-inner">商品信息</div>
								</div>
								<div class="th th-price">
									<div class="td-inner">单价</div>
								</div>
								<div class="th th-amount">
									<div class="td-inner">数量</div>
								</div>
								<div class="th th-sum">
									<div class="td-inner">金额</div>
								</div>


							</div>
						</div>
						<div class="clear"></div>
						<!-- -------------------------------------------------------------------------------------------------- -->
						<tr class="item-list">
							<c:forEach items="${cartSkus }" var="cs">
								<div class="bundle  bundle-last">
									<div class="bundle-main">
										<ul class="item-content clearfix">
											<div class="pay-phone">
												<li class="td td-item">
													<div class="item-pic">
														<a href="#" class="J_MakePoint"> <img
															src="${imgServer }/${ cs.image}"
															class="itempic J_ItemImg" height="100px" width="100px"></a>
													</div>
													<div class="item-info">
														<div class="item-basic-info">
															<a href="#" class="item-title J_MakePoint"
																data-point="tbcart.8.11">${cs.name}</a>
														</div>
													</div>
												</li>
												<li class="td td-info">
													<div class="item-props">
														<span class="sku-line">颜色：${cs.colorName}</span> <span
															class="sku-line">内存：${cs.storageName}</span>
													</div>
												</li>
												<li class="td td-price">
													<div class="item-price price-promo-promo">
														<div class="price-content">
															<em class="J_Price price-now">${cs.price}</em>
														</div>
													</div>
												</li>
											</div>
											<li class="td td-amount">
												<div class="amount-wrapper ">
													<div class="item-amount ">
														<span class="phone-title">购买数量</span>
														<div class="sl">

															<input class="text_box" name="" type="text"
																value="${cs.num }" style="width: 30px;"
																readonly="readonly" />
														</div>
													</div>
												</div>
											</li>
											<li class="td td-sum">
												<div class="td-inner">
													<em tabindex="0" class="J_ItemSum number">${cs.price * cs.num }</em>
												</div>
											</li>
											<li class="td td-oplist"></li>

										</ul>
									</div>
									<div class="clear"></div>

								</div>
							</c:forEach>
						</tr>
						<!-- ----------------------------------------------------------------------------------------- -->
						<div class="clear"></div>
					</div>

					<!-- ------------------------------------------------------------------------------------ -->
				</div>
				<div class="clear"></div>
				<div class="pay-total">
					<!--留言-->
					<div class="order-extra">
						<div class="order-user-info">
							<div id="holyshit257" class="memo">
								<label>买家留言：</label> <input type="text"
									title="选填,对本次交易的说明（建议填写已经和卖家达成一致的说明）"
									placeholder="选填,建议填写和卖家达成一致的说明"
									class="memo-input J_MakePoint c2c-text-default memo-close">
									<div class="msg hidden J-msg">
										<p class="error">最多输入500个字符</p>
									</div>
							</div>
						</div>

					</div>
					<div class="clear"></div>
				</div>


				<!--信息 -->
				<temple v-if="show">
				<div class="order-go clearfix">
					<div class="pay-confirm clearfix">
						<div class="box">
							<div tabindex="0" id="holyshit267" class="realPay">
								<em class="t">实付款：</em> <span class="price g_price "> <span>¥</span>
									<em class="style-large-bold-red " id="J_ActualFee">${money }</em>
								</span>
							</div>

							<div id="holyshit268" class="pay-address">

								<p class="buy-footer-address">
									<span class="buy-line-title buy-line-title-type">寄送至：</span> <span
										class="buy--address-detail"> <span class="province">{{sheng}}</span>省
										<span class="city">{{shi}}</span>市 <span class="dist">{{xian}}</span><span
										class="street">{{addr}}</span>
									</span> </span>
								</p>
								<p class="buy-footer-address">
									<span class="buy-line-title">收货人：</span> <span
										class="buy-address-detail"> <span class="buy-user">{{name}}
									</span> <span class="buy-phone">{{tell}}</span>
									</span>
								</p>
							</div>
						</div>

						<div id="holyshit269" class="submitOrder">
							<div class="go-btn-wrap">
								<a id="J_Go" @click="goSuccess()" class="btn-go" tabindex="0"
									title="点击此按钮，提交订单">提交订单</a>
							</div>
						</div>
						<div class="clear"></div>
					</div>
				</div>
				</temple>
				
			</div>

			<div class="clear"></div>
		</div>
		<div class="footer">
			<div class="footer-hd">
				<p>
					<a href="#">恒望科技</a> <b>|</b> <a href="#">商城首页</a> <b>|</b> <a
						href="#">支付宝</a> <b>|</b> <a href="#">物流</a>
				</p>
			</div>
			<div class="footer-bd">
				<p>
					<a href="#">关于恒望</a> <a href="#">合作伙伴</a> <a href="#">联系我们</a> <a
						href="#">网站地图</a> <em>© 2015-2025 Hengwang.com 版权所有. 更多模板 <a
						href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a>
						- Collect from <a href="http://www.cssmoban.com/" title="网页模板"
						target="_blank">网页模板</a></em>
				</p>
			</div>
		</div>
		<div class="theme-popover-mask"></div>
		<div class="theme-popover">

			<!--标题 -->
			<div class="am-cf am-padding">
				<div class="am-fl am-cf">
					<strong class="am-text-danger am-text-lg">新增地址</strong> / <small>Add
						address</small>
				</div>
			</div>
			<hr />

			<div class="am-u-md-12">
				<form class="am-form am-form-horizontal">

					<div class="am-form-group">
						<label for="user-name" class="am-form-label">收货人</label>
						<div class="am-form-content">
							<input type="text" id="user-name" placeholder="收货人"
								v-model="name">
						</div>
					</div>

					<div class="am-form-group">
						<label for="user-phone" class="am-form-label">手机号码</label>
						<div class="am-form-content">
							<input id="user-phone" placeholder="手机号必填" v-model="tell">
						</div>
					</div>

					<div class="am-form-group">
						<label for="user-phone" class="am-form-label">所在地</label>
						<div class="am-form-content address">
							<select data-am-selected v-model="sheng">
								<option value="浙江省">浙江省</option>
								<option value="湖北省">湖北省</option>
							</select> <select data-am-selected v-model="shi">
								<option value="温州市">温州市</option>
								<option value="武汉">武汉市</option>
							</select> <select data-am-selected v-model="xian">
								<option value="瑞安">瑞安区</option>
								<option value="洪山区">洪山区</option>
							</select>
						</div>
					</div>

					<div class="am-form-group">
						<label for="user-intro" class="am-form-label">详细地址</label>
						<div class="am-form-content">
							<textarea class="" rows="3" id="user-intro" placeholder="输入详细地址"
								v-model="addr"></textarea>

						</div>
					</div>

					<div class="am-form-group theme-poptit">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<div class="am-btn am-btn-danger close" @click="save()">保存</div>
							<div class="am-btn am-btn-danger close">取消</div>
						</div>
					</div>
				</form>
			</div>
			<!-- <div class="am-u-md-12">
				<form class="am-form am-form-horizontal">

					<div class="am-form-group">
						<label for="user-name" class="am-form-label">收货人</label>
						<div class="am-form-content">
							<input type="text" id="user-name" placeholder="收货人"
								v-model="shou.name">
						</div>
					</div>

					<div class="am-form-group">
						<label for="user-phone" class="am-form-label">手机号码</label>
						<div class="am-form-content">
							<input id="user-phone" placeholder="手机号必填" v-model="shou.tell">
						</div>
					</div>

					<div class="am-form-group">
						<label for="user-phone" class="am-form-label">所在地</label>
						<div class="am-form-content address">
							<select data-am-selected v-model="shou.sheng">
								<option value="浙江省">浙江省</option>
								<option value="湖北省">湖北省</option>
							</select> <select data-am-selected v-model="shou.shi">
								<option value="温州市">温州市</option>
								<option value="武汉">武汉市</option>
							</select> <select data-am-selected v-model="shou.xian">
								<option value="瑞安">瑞安区</option>
								<option value="洪山区">洪山区</option>
							</select>
						</div>
					</div>

					<div class="am-form-group">
						<label for="user-intro" class="am-form-label">详细地址</label>
						<div class="am-form-content">
							<textarea class="" rows="3" id="user-intro" placeholder="输入详细地址"
								v-model="shou.addr"></textarea>

						</div>
					</div>

					<div class="am-form-group theme-poptit">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<div class="am-btn am-btn-danger close" @click="save()">保存</div>
							<div class="am-btn am-btn-danger close">取消</div>
						</div>
					</div>
				</form>
			</div> -->

		</div>

		<div class="clear"></div>
	</div>
	<script type="text/javascript" src="${resourceServer }/js/vue.min.js"></script>
	<script>
		var a = "${cartSkus}";
		console.log(a);
		//var list = $.parseJSON( a );
		var vue = new Vue({
			el : "#app",
			data : {
				name : "",
				tell : "",
				sheng : "",
				shi : "",
				xian : "",
				addr : "",
				show:false
			/* shou : {
				name : "",
				tell : "",
				sheng : "",
				shi : "",
				xian : "",
				addr : ""
			},
			addrlist : [],
			i : null */

			},
			methods : {
				save : function() {
					this.show = true

					//this.addrlist.push(this.shou);
					/* this.addrlist[this.i] = this.shou;
					this.i = this.i+ 1*1; */

					/* alert(this.addrlist[this.i].name);
					alert(this.addrlist[this.i].tell);
					alert(this.addrlist[this.i].sheng);
					alert(this.addrlist[this.i].shi);
					alert(this.addrlist[this.i].xian);
					alert(this.addrlist[this.i].addr); */
					/* this.shou.name = "";
					this.shou.tell = "";
					this.shou.sheng = "";
					this.shou.shi = "";
					this.shou.xian = "";
					this.shou.addr = ""; */
					//this.shou.name = "";
					//console.log(this.addrlist);
				},
				/* delClick : function(index) {
					//alert(index);
					this.addrlist.splice(index, 1);
				}, */
				/* choose : function(index) {
					alert(this.addrlist[index].name);
					this.i = index;
				}, */
				goSuccess : function() {
					//alert("ok");
					var address = this.sheng +" "+ this.shi + " " + this.xian +" "+this.addr;
					//alert(address);
					var name = this.name;
					var tell = this.tell;
					 $.ajax({
						url : "${basepath}/pay/success.do",
						type : "get",
						dataType : "json",
						async : false,
						data : {
							address:address,
							name:name,
							tell:tell
						},
						success : function(data) {
							//alert(data);
							window.location.href = "${basepath}/pay/goSuccess.do";
						},
						error:function(data){
							//alert("付款失败"+data);
							window.location.href = "${basepath}/pay/goSuccess.do";
						}
					}) 
				}

			}
		});
	</script>
</body>

</html>